<?php


namespace app\common\model;

use think\facade\Db;
class Article extends Base
{
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    public function ajaxCateadmin($article_name,$id = 0){
        if(empty($article_name)){
            return 1;
        }
        //组装where条件
        $where = array();
        $where[] = array('article_name','=',$article_name);
        if($id > 0){
            $where[] =  array('id','<>',$id);
        }
        return Db::name('article')->where($where)->find();
    }
}